#include <thread>
#include <iostream>

//仿函数
class Func{
public:
    void operator()(int &sum, int L, int R) {
        while (L <= R) {
            sum += L;
            L++;
        }
    }
};

int main()
{
    Func f;
    int sum = 0;
    std::thread t1 = std::thread(f, sum,  1, 100);
    std::cout << sum << std::endl;
    return 0;
}